import Cookies from 'js-cookie'

const TokenKey: string = 'Admin-Token'
const UserNameKey: string = 'Admin-Username'
const RoleKey: string = 'Admin-Role'

export function getToken(): string {
  return Cookies.get(TokenKey) as string
}

export function setToken(token: string) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getUsername(): string {
  return Cookies.get(UserNameKey) as string
}

export function setUsername(username: string) {
  return Cookies.set(UserNameKey, username)
}

export function removeUsername() {
  return Cookies.remove(UserNameKey)
}

export function getRole(): string {
  return Cookies.get(RoleKey) as string
}

export function setRole(role: string) {
  return Cookies.set(RoleKey, role)
}

export function removeRole() {
  return Cookies.remove(RoleKey)
}
